package org.tema.web;

import javax.ejb.EJB;

import org.tema.ejb.UserBeanLocal;
import org.tema.entities.UserGroup;

public class GroupBean {
	
	@EJB
	private UserBeanLocal userBean;
	
	
	private String name;
	private String description;

	
	
	public String getName() {
		return this.name;
	}
	
	
	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
	
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String saveGroup(){
		 UserGroup group = userBean.createUserGroup( this.name , this.description );
		 if (group != null){
			 return "success"; 
		 }
		 else {
			 return "failure";
		 }
			 
	}
	
}
